-- UNITDEF -- A10 --
--------------------------------------------------------------------------------

local unitName = "a10"

--------------------------------------------------------------------------------

local unitDef = {
  acceleration       = 5,
  attackrunlength    = "700",
  bankscale          = "1",
  bmcode             = "1",
  brakeRate          = 3,
  buildCostEnergy    = 0,
  buildCostMetal     = 0,
  builder            = false,
  buildTime          = 30,
  canAttack          = true,
  canFly             = true,
  canGuard           = true,
  canMove            = true,
  canPatrol          = true,
  canstop            = "1",
  cantBeTransported  = true,
  category           = "TARGET AIR",
  collide            = false,
  cruiseAlt          = 400,
  defaultmissiontype = "VTOL_standby",
  description        = "Anti-mech aircraft",
  explodeAs          = "SMALL_UNITEX",
  firestandorders    = "1",
  footprintX         = 4,
  footprintZ         = 4,
  collisionvolumetype  = "box",
  collisionvolumescales = "30 20 50",
  collisionvolumeoffsets = "0 0 0",
  collisionVolumeTest = 1;
  customparams = {
		trailtex = "bitmaps/projectiletextures/trail.png",
		trailr = "0.3",
		trailg = "0.3",
		trailb = "0.3",
		trailalpha = "1",
  },
  ---iconType           = "airsupport",
  idleAutoHeal       = 0,
  maneuverleashlength = "1000",
  maxDamage          = 800,
  maxSlope           = 150,
  maxVelocity        = 10,
  maxWaterDepth      = 0,
  mobilestandorders  = "1",
  name               = "A12 Tankbuster",
  objectName         = "a10.s3o",
  pitchscale         = "2",
  power              = 15,
  reclaimable        = false,
  selfDestructAs     = "SMALL_UNITEX",
  shootme            = "1",
  sightDistance      = 900,
  standingfireorder  = "2",
  standingmoveorder  = "1",
  steeringmode       = "1",
  TEDClass           = "VTOL",
  threed             = "1",
  transportByEnemy   = false,
  turnRate           = 2000,
  unitname           = "a10",
  unitnumber         = "643",
  version            = "1",
  zbuffer            = "1",
  sfxtypes = {
    explosiongenerators = {
 [[custom:flashmuzzle1]],  --muuzzle
 [[custom:missileshot]],    },
  },
  weapons = {
    [1]  = {
	badTargetCategory  = [[NOTARGET AIR BASE]],
      mainDir            = "0 0 1",
      maxAngleDif        = 80,
      name               = "a10gun",
    },
    [2]  = {
	badTargetCategory  = [[NOTARGET AIR BASE]],
      mainDir            = "0 -1 0",
      maxAngleDif        = 80,
      name               = "a10bomb",
    },
    [3]  = {
	badTargetCategory  = [[NOTARGET AIR BASE]],
    mainDir            = "0 0 1",
    maxAngleDif        = 90,
    name               = "a10rocket",
    },
  },
  
  weaponDefs          = {

	a10gun = {
	accuracy           = 700,
  areaOfEffect       = 5,
  beamTime           = 0.3,
  beamWeapon         = true,
  burnblow           = true,
  color              = 223,
  coreThickness      = 0.2,
  explosionGenerator = "custom:flashplosion",
  guidance           = true,
  id                 = 222,
  impulseFactor      = 0,
  largeBeamLaser     = true,
  lineOfSight        = true,
  name               = "GAU9000",
  noSelfDamage       = true,
  range              = 800,
  reloadtime         = 0.1,
  renderType         = 1,
  selfprop           = true,
  soundStart         = "gunfire",
  texture1           = "shot",
  thickness          = 4,
  tracks             = true,
  turnRate           = 10000,
  turret             = true,
  weaponVelocity     = 1000,
  damage = {
    engine           = "5",
    base          = "0",
    default            = 10,
			},
	},
  
     a10bomb  = {
      name                    = [[Guided Bomb]],
      areaOfEffect            = 100,
      avoidFeature            = false,
      avoidFriendly           = false,
	  burst = 4,
	  burstrate = 0.2,
      burnblow                = true,
     --- cegTag                  = [[ROCKETTRAIL]],
      collideFriendly         = false,
      craterBoost             = 1,
      craterMult              = 2,

      damage                  = {
        default = 200,
        engine  = 100,
        base    = 20,
      },

	  explosionGenerator = "custom:ARTILLERY_EXPLOSION",
      fireStarter             = 70,
      flightTime              = 2,
      guidance                = true,
      impulseBoost            = 0,
      impulseFactor           = 0.4,
      interceptedByShieldType = 2,
      lineOfSight             = true,
      model                   = [[a10bomb.s3o]],
      noSelfDamage            = true,
      range                   = 300,
      reloadtime              = 90,
      renderType              = 1,
      selfprop                = true,
      smokedelay              = [[0.1]],
      smokeTrail              = false,
      soundHit                = [[bombhit]],
      soundStart              = [[BombRelRemake]],
      startsmoke              = [[1]],
      startVelocity           = 300,
      targetMoveError         = 0.2,
      tolerance               = 8000,
      tracks                  = false,
      turnRate                = 1,
      turret                  = true,
      waterweapon             = true,
      weaponAcceleration      = 300,
      weaponTimer             = 0.1,
      weaponType              = [[MissileLauncher]],
      weaponVelocity          = 300,
    },
	
	a10rocket = {
      name                    = [[Guided Missiles]],
      areaOfEffect            = 32,
      avoidFriendly           = false,
	  burst = 6,
	  burstrate = 0.2,
      canattackground         = false,
      canAttackGround         = 1,
      cegTag                  = [[ROCKETTRAIL]],
      collideFriendly         = false,
      craterBoost             = 1,
      craterMult              = 2,
      cylinderTargetting      = 1,

      damage                  = {
        default = 150,
        engine  = 100,
        base    = 20,
      },

      explosionGenerator      = [[custom:MISSILE_Explosion]],
      fireStarter             = 70,
      flightTime              = 6,
      guidance                = true,
      impactOnly              = true,
      impulseBoost            = 0,
      impulseFactor           = 0.4,
      interceptedByShieldType = 2,
      lineOfSight             = true,
      metalpershot            = 0,
      model                   = [[a10rocket.s3o]],
      noSelfDamage            = true,
      range                   = 750,
      reloadtime              = 90,
      renderType              = 1,
      selfprop                = true,
      smokedelay              = [[0.1]],
      smokeTrail              = true,
      soundHit                = [[bombhit]],
      soundStart              = [[rocket]],
      startsmoke              = [[1]],
      startVelocity           = 450,
      texture2                = [[none]],
      tolerance               = 40000,
      tracks                  = true,
      turnRate                = 50000,
      weaponAcceleration      = 450,
      weaponTimer             = 3.5,
      weaponType              = [[MissileLauncher]],
      weaponVelocity          = 850,
    },
  },
}


--------------------------------------------------------------------------------

return lowerkeys({ [unitName] = unitDef })

--------------------------------------------------------------------------------
